import './assets/main.css'
import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'
import store from './stores'
// 通过后端接口获取数据
import axios from 'axios'
// Vue.prototype.$axios = axios
axios.defaults.baseURL = 'http://localhost:8081'

//引入 Element Plus 组件库及其样式文件
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
//引入 Element Plus 的所有图标库
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(store)
app.use(ElementPlus)  //将 Element Plus 注册为 Vue 应用的插件，使其所有组件在应用中可用
//循环遍历 ElementPlusIconsVue 对象中的所有图标组件，并将每个图标组件注册到 Vue 应用中
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.mount('#app')
